home *** CD-ROM | disk | FTP | other *** search
- /*
- IC Universals.h
-
- See IC Universals.c for the comment.
- */
-
- #pragma once
-
- #ifndef __H_IC_Universals__
- #define __H_IC_Universals__
-
- typedef OSErr (*ApplicationProcPtr)(void);
- typedef OSErr (*DocumentProcPtr)(FSSpec* spec);
- typedef OSErr (*WindowPlainProcPtr)(WindowType wt,short item);
- typedef OSErr (*WindowEventProcPtr)(WindowType wt,short item,EventRecord* er);
- typedef OSErr (*WindowBooleanProcPtr)(WindowType wt,short item,Boolean act);
- typedef OSErr (*WindowCursorProcPtr)(WindowType wt,short item,Point where,short cursid);
- typedef pascal void (*ListKeyProcPtr)(ListHandle lh,Cell c,StringPtr str);
- typedef pascal void (*BeeperProcPtr)(short sound);
-
- enum {
- uppApplicationProcInfo=kCStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(OSErr))),
- uppDocumentProcInfo=kCStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
- | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(FSSpec*))),
- uppWindowPlainProcInfo=kCStackBased
- |RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
- |STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(WindowType)))
- |STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(short))),
- uppWindowEventProcInfo=kCStackBased
- |RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
- |STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(WindowType)))
- |STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(short)))
- |STACK_ROUTINE_PARAMETER(3,SIZE_CODE(sizeof(EventRecord*))),
- uppWindowBooleanProcInfo=kCStackBased
- |RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
- |STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(WindowType)))
- |STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(short)))
- |STACK_ROUTINE_PARAMETER(3,SIZE_CODE(sizeof(Boolean))),
- uppWindowCursorProcInfo=kCStackBased
- |RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
- |STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(WindowType)))
- |STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(short)))
- |STACK_ROUTINE_PARAMETER(3,SIZE_CODE(sizeof(Point)))
- |STACK_ROUTINE_PARAMETER(4,SIZE_CODE(sizeof(short))),
- uppListKeyProcInfo=kPascalStackBased
- | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(ListHandle)))
- | STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(Cell)))
- | STACK_ROUTINE_PARAMETER(3,SIZE_CODE(sizeof(StringPtr))),
- uppBeeperProcInfo=kPascalStackBased
- | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(short)))
- };
-
- #if USESROUTINEDESCRIPTORS
- typedef UniversalProcPtr ApplicationUPP;
- typedef UniversalProcPtr DocumentUPP;
- typedef UniversalProcPtr WindowPlainUPP;
- typedef UniversalProcPtr WindowEventUPP;
- typedef UniversalProcPtr WindowBooleanUPP;
- typedef UniversalProcPtr WindowCursorUPP;
- typedef UniversalProcPtr ListKeyUPP;
- typedef UniversalProcPtr BeeperUPP;
-
- #define CallApplicationProc(p) \
- CallUniversalProc((UniversalProcPtr)(p),uppApplicationProcInfo)
- #define CallDocumentProc(p,spec) \
- CallUniversalProc((UniversalProcPtr)(p),uppDocumentProcInfo,(spec))
- #define CallWindowPlainProc(p,w,i)\
- CallUniversalProc((UniversalProcPtr)(p),uppWindowPlainProcInfo,(w),(i))
- #define CallWindowEventProc(p,w,i,e)\
- CallUniversalProc((UniversalProcPtr)(p),uppWindowEventProcInfo,(w),(i),(e))
- #define CallWindowBooleanProc(p,w,i,b)\
- CallUniversalProc((UniversalProcPtr)(p),uppWindowBooleanProcInfo,(w),(i),(b))
- #define CallWindowCursorProc(p,w,i,t,c)\
- CallUniversalProc((UniversalProcPtr)(p),uppWindowCursorProcInfo,(w),(i),(t),(c))
- #define CallListKeyProc(p,l,c,s) \
- CallUniversalProc((UniversalProcPtr)(p),uppListKeyProcInfo,(l),(c),(s))
- #define CallBeeperProc(p,n) \
- CallUniversalProc((UniversalProcPtr)(p),uppBeeperProcInfo,(n))
-
- #define NewApplicationProc(routine) \
- (ApplicationUPP)NewRoutineDescriptor((ProcPtr)(routine),uppApplicationProcInfo,GetCurrentISA())
- #define NewDocumentProc(routine) \
- (DocumentUPP)NewRoutineDescriptor((ProcPtr)(routine),uppDocumentProcInfo,GetCurrentISA())
- #define NewWindowPlainProc(routine) \
- (WindowPlainUPP)NewRoutineDescriptor((ProcPtr)(routine),uppWindowPlainProcInfo,GetCurrentISA())
- #define NewWindowEventProc(routine) \
- (WindowEventUPP)NewRoutineDescriptor((ProcPtr)(routine),uppWindowEventProcInfo,GetCurrentISA())
- #define NewWindowBooleanProc(routine) \
- (WindowBooleanUPP)NewRoutineDescriptor((ProcPtr)(routine),uppWindowBooleanProcInfo,GetCurrentISA())
- #define NewWindowCursorProc(routine) \
- (WindowCursorUPP)NewRoutineDescriptor((ProcPtr)(routine),uppWindowCursorProcInfo,GetCurrentISA())
- #define NewListKeyProc(routine) \
- (ListKeyUPP)NewRoutineDescriptor((ProcPtr)(routine),uppListKeyProcInfo,GetCurrentISA())
- #define NewBeeperProc(routine) \
- (BeeperUPP)NewRoutineDescriptor((ProcPtr)(routine),uppBeeperProcInfo,GetCurrentISA())
-
- #define DisposeApplicationProc(routine) \
- DisposeRoutineDescriptor((UniversalProcPtr)(routine))
- #define DisposeDocumentProc(routine) \
- DisposeRoutineDescriptor((UniversalProcPtr)(routine))
- #define DisposeWindowPlainProc(routine) \
- DisposeRoutineDescriptor((UniversalProcPtr)(routine))
- #define DisposeWindowEventProc(routine) \
- DisposeRoutineDescriptor((UniversalProcPtr)(routine))
- #define DisposeWindowBooleanProc(routine) \
- DisposeRoutineDescriptor((UniversalProcPtr)(routine))
- #define DisposeWindowCursorProc(routine) \
- DisposeRoutineDescriptor((UniversalProcPtr)(routine))
- #define DisposeListKeyProc(routine) \
- DisposeRoutineDescriptor((UniversalProcPtr)(routine))
- #define DisposeBeeperProc(routine) \
- DisposeRoutineDescriptor((UniversalProcPtr)(routine))
-
- #else
- typedef ApplicationProcPtr ApplicationUPP;
- typedef DocumentProcPtr DocumentUPP;
- typedef WindowPlainProcPtr WindowPlainUPP;
- typedef WindowEventProcPtr WindowEventUPP;
- typedef WindowBooleanProcPtr WindowBooleanUPP;
- typedef WindowCursorProcPtr WindowCursorUPP;
- typedef ListKeyProcPtr ListKeyUPP;
- typedef BeeperProcPtr BeeperUPP;
-
- #define CallApplicationProc(p) (*(p))()
- #define CallDocumentProc(p,spec) (*(p))(spec)
- #define CallWindowPlainProc(p,w,i) (*(p))((w),(i))
- #define CallWindowEventProc(p,w,i,e) (*(p))((w),(i),(e))
- #define CallWindowBooleanProc(p,w,i,b) (*(p))((w),(i),(b))
- #define CallWindowCursorProc(p,w,i,t,c) (*(p))((w),(i),(t),(c))
- #define CallListKeyProc(p,l,c,s) (*(p))((l),(c),(s))
- #define CallBeeperProc(p,n) (*(p))(n)
-
- #define NewApplicationProc(routine) (ApplicationUPP)(routine)
- #define NewDocumentProc(routine) (DocumentUPP)(routine)
- #define NewWindowPlainProc(routine) (WindowPlainUPP)(routine)
- #define NewWindowEventProc(routine) (WindowEventUPP)(routine)
- #define NewWindowBooleanProc(routine) (WindowBooleanUPP)(routine)
- #define NewWindowCursorProc(routine) (WindowCursorUPP)(routine)
- #define NewListKeyProc(routine) (ListKeyUPP)(routine)
- #define NewBeeperProc(routine) (BeeperUPP)(routine)
-
- #define DisposeApplicationProc(routine)
- #define DisposeDocumentProc(routine)
- #define DisposeWindowPlainProc(routine)
- #define DisposeWindowEventProc(routine)
- #define DisposeWindowBooleanProc(routine)
- #define DisposeWindowCursorProc(routine)
- #define DisposeListKeyProc(routine)
- #define DisposeBeeperProc(routine)
-
- #endif
-
- // External Global Declarations
- extern DlgHookUPP gButtonHookUPP;
- extern ModalFilterUPP gAskServerFilter;
- extern UserItemUPP gDisplayFontProc;
- extern ModalFilterUPP gMyModalFilter;
- extern AEEventHandlerUPP gHandleEditPrefAE;
- extern DeviceLoopDrawingUPP gButtonDeviceLoopProc;
- extern UserItemUPP gButtonUserItemUpdate;
- extern FileFilterYDUPP gMyCustomGetDirectoryFileFilter;
- extern DlgHookYDUPP gMyCustomGetDirectoryDlogHook;
- extern UserItemUPP gDrawTextProc;
- extern ModalFilterUPP gCancelModalFilter;
- extern UserItemUPP gHelperUserItemUpdate;
- extern ListDefUPP gHelperLDEF;
- extern ModalFilterUPP gDoAddFilter;
- extern ListKeyUPP gGetHelpEntryName;
- extern ListKeyUPP gGetFileMapEntryName;
- extern ModalFilterUPP gCancelDiscardModalFilter;
- extern UserItemUPP gFileMapUserItemUpdate;
- extern ListDefUPP gFileListLDEF;
- extern ModalFilterUPP gOKModalFilter;
- extern ModalFilterUPP gAddChangeFilter;
- extern UserItemUPP gOutlineDefault1;
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- void InitUniversals(void);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* __H_IC_Universals__ */
-
-
-